{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        },
        "vscode": {
          "languageId": "dotnet-interactive.csharp"
        }
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>DataView.InteractiveExtension, 1.0.45</span></li><li><span>Microsoft.Data.Analysis, 0.19.1</span></li><li><span>Microsoft.ML.DataView, 1.7.1</span></li><li><span>SandDance.InteractiveExtension, 1.0.45</span></li></ul></div></div>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "#r \"nuget:SandDance.InteractiveExtension,*-*\"\n",
        "#r \"nuget:DataView.InteractiveExtension,*-*\"\n",
        "#r \"nuget:Microsoft.ML.DataView\"\n",
        "#r \"nuget: Microsoft.Data.Analysis\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        },
        "vscode": {
          "languageId": "dotnet-interactive.csharp"
        }
      },
      "outputs": [],
      "source": [
        "using System.IO;\n",
        "using System.Net.Http;\n",
        "\n",
        "var contents = await new HttpClient()\n",
        ".GetStringAsync(\"https://raw.githubusercontent.com/ageron/handson-ml2/master/datasets/housing/housing.csv\");"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        },
        "vscode": {
          "languageId": "dotnet-interactive.csharp"
        }
      },
      "outputs": [],
      "source": [
        "using Microsoft.Data.Analysis;\n",
        "using Microsoft.ML;\n",
        "using System.Collections.Generic;\n",
        "\n",
        "var housingData = DataFrame.LoadCsvFromString(contents);"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        },
        "vscode": {
          "languageId": "dotnet-interactive.csharp"
        }
      },
      "outputs": [
        {
          "data": {
            "text/csv": [
              "\r\n"
            ],
            "text/html": [
              "<div style=\"background-color:white;\">\r\n",
              "<div id=\"918decee1f2a44029943a1e4c43bcb31\" style=\"height: 100ch ;margin: 2px;\">\r\n",
              "</div>\r\n",
              "<script type=\"text/javascript\">\r\n",
              "\r\n",
              "renderSandDanceExplorer_918decee1f2a44029943a1e4c43bcb31 = () => {\r\n",
              "\r\n",
              "    (require.config({ 'paths': { 'context': '1.0.252001', 'sandDanceUri' : 'https://colombod.github.io/dotnet-interactive-cdn/extensionlab/1.0.252001/SandDance/sanddanceapi', 'urlArgs': 'cacheBuster=521e15ca684e408e82b8966d38694a68' }}) || require)(['sandDanceUri'], (sandDance) => {\r\n",
              "\r\n",
              "        sandDance.createSandDanceExplorer({\r\n",
              "            data: {\r\n",
              "  \"profile\": \"tabular-data-resource\",\r\n",
              "  \"schema\": {\r\n",
              "    \"primaryKey\": [],\r\n",
              "    \"fields\": []\r\n",
              "  },\r\n",
              "  \"data\": []\r\n",
              "},\r\n",
              "            id: \"918decee1f2a44029943a1e4c43bcb31\",\r\n",
              "            container: document.getElementById(\"918decee1f2a44029943a1e4c43bcb31\")\r\n",
              "        });\r\n",
              "    },\r\n",
              "    (error) => {\r\n",
              "        console.log(error);\r\n",
              "    });\r\n",
              "};\r\n",
              "// ensure `require` is available globally\r\n",
              "if ((typeof(require) !==  typeof(Function)) || (typeof(require.config) !== typeof(Function))) {\r\n",
              "    let require_script = document.createElement('script');\r\n",
              "    require_script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js');\r\n",
              "    require_script.setAttribute('type', 'text/javascript');\r\n",
              "    \r\n",
              "    \r\n",
              "    require_script.onload = function() {\r\n",
              "        renderSandDanceExplorer_918decee1f2a44029943a1e4c43bcb31();\r\n",
              "    };\r\n",
              "\r\n",
              "    document.getElementsByTagName('head')[0].appendChild(require_script);\r\n",
              "}\r\n",
              "else {\r\n",
              "    renderSandDanceExplorer_918decee1f2a44029943a1e4c43bcb31();\r\n",
              "}\r\n",
              "\r\n",
              " </script>\r\n",
              "</div>\r\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "housingData.ToTabularDataResource().ExploreWithSandDance().Display();"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": ".NET (C#)",
      "language": "C#",
      "name": ".net-csharp"
    },
    "language_info": {
      "file_extension": ".cs",
      "mimetype": "text/x-csharp",
      "name": "C#",
      "pygments_lexer": "csharp",
      "version": "8.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
